import React from 'react'
import './index.less'
import { Button, Card, Notification, notification } from "antd";
import '../ui.less'
export default class Notifications extends React.Component {
    handleOpenNotification = (type,derection) => {
        if(derection){
            notification.config({
                placement:derection
            })
        }
        notification[type]({
            message: '发工资了',
            description: '今天15号了，发工工资了！'
        })
    }
    render() {
        return (
            <div className="home-wrap">
                <Card title="通知提醒框" className="card-warp">
                    <Button icon="wechat" type="primary" onClick={() => this.handleOpenNotification('success','topLeft')}>Success</Button>
                    <Button icon="wechat" type="primary" onClick={() => this.handleOpenNotification('info','topRight')}>Info</Button>
                    <Button icon="wechat" type="primary" onClick={() => this.handleOpenNotification('warning','bottomLeft')}>Warning</Button>
                    <Button icon="wechat" type="primary" onClick={() => this.handleOpenNotification('error','bottomRight')}>Error</Button>
                </Card>
            </div>
        )
    }
}